﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package reprise.commands {
    import flash.events.*;
    import flash.utils.*;

    public class TimerCommand extends AbstractAsynchronousCommand {

        private var m_timer:Timer;

        public function TimerCommand(_arg1:Number){
            m_timer = new Timer(_arg1, 1);
            m_timer.addEventListener(TimerEvent.TIMER_COMPLETE, timer_complete);
        }
        override public function cancel():void{
            m_timer.removeEventListener(TimerEvent.TIMER_COMPLETE, timer_complete);
            m_timer.stop();
            super.cancel();
        }
        protected function timer_complete(_arg1:TimerEvent):void{
            m_timer.removeEventListener(TimerEvent.TIMER_COMPLETE, timer_complete);
            notifyComplete(true);
        }
        override public function execute(... _args):void{
            super.execute();
            m_timer.start();
        }

    }
}//package reprise.commands 
